package com.hyacinth.netty.protocol;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import static com.hyacinth.netty.CommandType.MSG;


/**
 * 消息数据包
 * @author zhangfb
 * @version 1.0.0.1
 * @since JDK 1.8
 */
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Data
public class MessagePacket extends Packet {

    private long toUserId;

    private String message;

    public MessagePacket(long toUserId, String message) {
        this.toUserId = toUserId;
        this.message = message;
    }

    @Override
    public Byte getCommand() {
        return MSG;
    }
}
